-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Feature: DynamoDB Multi-Attribute Keys for Global Secondary Index #45357
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Community GuidelinesThis comment is added to every new Pull Request to provide quick reference to how the Terraform AWS Provider is maintained. Please review the information below, and thank you for contributing to the community that keeps the provider thriving! 🚀 Voting for Prioritization
Pull Request Authors
|
|
✅ Thank you for correcting the previously detected issues! The maintainers appreciate your efforts to make the review process as smooth as possible. |
| "hash_keys": { | ||
| Type: schema.TypeSet, | ||
| Optional: true, | ||
| Computed: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for my edification, what does computed mean in this context?
| if set, ok := hks.(*schema.Set); ok && set.Len() == 0 { | ||
| delete(oldAttributes, "hash_keys") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we instead throw error when a customer picks both options?
| if len(hashKeys) == 1 { | ||
| gsi["hash_key"] = hashKeys[0] | ||
| } else if len(hashKeys) > 1 { | ||
| gsi["hash_keys"] = hashKeys | ||
| } | ||
|
|
||
| if len(rangeKeys) == 1 { | ||
| gsi["range_key"] = rangeKeys[0] | ||
| } else if len(rangeKeys) > 1 { | ||
| gsi["range_keys"] = rangeKeys |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we internally always just start using hash_keys and range_keys and the customer facing api model can still contain the single range_key which internally just gets translated to a singleton list of range_keys
roagrawa
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
feature wise looks correct behavior, will let terraform expert verify the expected behaviors are enforced correctly
Rollback Plan
If a change needs to be reverted, we will publish an updated version of the library.
Changes to Security Controls
Are there any changes to security controls (access controls, encryption, logging) in this pull request? If so, explain.
Description
This change adds support for Multi-Attribute keys in Dynamo DB which was recently added. Documentation page
Relations
Closes #45216
References
https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/GSI.DesignPattern.MultiAttributeKeys.html
Output from Acceptance Testing